<template>
  <base-form :form="form">
    <el-form-item :label="$t('模式')">
      <el-select disabled v-model="form.timerAttr.type" class="input-width">
        <el-option v-for="(item) in timerTypes" :key="item.value" :label="item.name" :value="item.value"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item :label="$t('格式')">
      <el-select disabled v-model="form.timerAttr.link" class="input-width">
        <el-option v-for="(item) in timerFormats" :key="item.value" :label="item.name" :value="item.value"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item :label="$t('字体')">
      <el-select disabled v-model="form.timerAttr.font" class="input-width">
        <el-option v-for="(item) in fontItems" :key="item.value" :label="item.name" :value="item.value"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item :label="$t('字号')">
      <el-select disabled v-model="form.timerAttr.size" class="input-width"></el-select>
    </el-form-item>
    <el-form-item :label="$t('颜色')">
      <div class="flex">
        <el-color-picker disabled @change="() => {}" v-model="form.timerAttr.color"></el-color-picker>
      </div>
    </el-form-item>
    <div class="label">{{ $t('到期日期') }}</div>
    <el-form-item label-width="0">
      <el-date-picker
        disabled
        v-model="form.timerAttr.endDate"
        class="full-width"
        type="date"
        value-format="yyyy-MM-dd"
        :placeholder="$t('选择日期')">
      </el-date-picker>
    </el-form-item>
    <div class="label">{{ $t('到期时间') }}</div>
    <el-form-item label-width="0">
      <el-time-picker
        disabled
        v-model="form.timerAttr.endTime"
        class="full-width"
        value-format="HH:mm:ss"
        :placeholder="$t('选择时间')">
      </el-time-picker>
    </el-form-item>
  </base-form>
</template>

<script>
import BaseForm from './BaseForm'
import { fontItemArray, timerFormatArray } from "@/const/index";
export default {
  components: {
    BaseForm
  },
  props: {
    form: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  data() {
    return {
      timerTypes: [
        { name:'倒计时', value: -1 },
        { name:'顺计时', value: 0 }
      ],
      timerFormats: timerFormatArray,
      fontItems: fontItemArray,
    }
  }
}
</script>

<style lang="scss" scoped>
.input-width {
  width: 200px;
}
.flex {
  display: flex;
  align-items: center;
  height: 28px;
}
.bg-btn {
  width: 22px;
  height: 20px;
  background: $defaultBlue;
}
.label {
  margin-bottom: 15px;
}
.full-width {
  width: 240px;
}
</style>